package com.elias.share.vo.resp;

import cn.hutool.core.io.unit.DataSizeUtil;
import com.elias.share.config.bean.FileInfo;
import lombok.Data;

@Data
public class FileInfoRespVo {
    private String usedSize;

    private String maxSize;

    private String location;

    private String minExpireTime;

    private String maxExpireTime;

    public FileInfoRespVo(FileInfo fileInfo) {
        this.location = fileInfo.getLocation();
        this.maxExpireTime = fileInfo.getMaxExpireTime() + " minutes";
        this.minExpireTime = fileInfo.getMinExpireTime() + " minutes";
        this.usedSize = DataSizeUtil.format(fileInfo.getUsedSize().toBytes());
        this.maxSize = DataSizeUtil.format(fileInfo.getMaxSize().toBytes());
    }
}
